import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/Layout/index.vue'

const routes = [
    {
        path: '/',
        redirect: '/index',
    },
    {
        path: '/index',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'index',
                path: '/index',
                component: () => import('../views/homePage/index.vue'),
            },
        ],
    },
    {
        path: '/private',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'private',
                path: '/private',
                component: () => import('../views/private/index.vue'),
            },
        ],
    },
    {
        path: '/projectPrice',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'projectPrice',
                path: '/projectPrice',
                component: () => import('../views/projectPrice/index.vue'),
            },
        ],
    },
    {
        path: '/aboutUs',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'aboutUs',
                path: '/aboutUs',
                component: () => import('../views/aboutUs/index.vue'),
            },
        ],
    },
    {
        path: '/download',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'download',
                path: '/download',
                component: () => import('../views/download/index.vue'),
            },
        ],
    },
    {
        path: '/cooperateAgent',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'cooperateAgent',
                path: '/cooperateAgent',
                component: () => import('../views/cooperateAgent/index.vue'),
            },
        ],
    },
    {
        path: '/customerCase',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'customerCase',
                path: '/customerCase',
                component: () => import('../views/customerCase/index.vue'),
            },
        ],
    },
    {
        path: '/news',
        component: Layout,
        meta: { hideElement: false },
        children: [
            {
                name: 'news',
                path: '/news',
                component: () => import('../views/news/index.vue'),
            },
            {
                name: 'newsInfo',
                path: '/newsInfo',
                component: () => import('../views/news/info.vue'),
            },
        ],
    },
]

const router = createRouter({
    history: createWebHistory('/website'),
    routes,
    scrollBehavior: () => ({ left: 0, top: 0 }),
})

export default router